package com.lz.football.module.explore
{
	import com.common.stdlib.DateUtil;
	import com.common.utils.Reflection;
	import com.common.utils.timeUtils.TimerManager;
	import com.global.GlobalDef;
	import com.greensock.TweenLite;
	import com.liangzhong.events.AppEventDispatcher;
	import com.liangzhong.events.ExploreEvent;
	import com.liangzhong.events.ModuleEvent;
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.club.vo.ClubInformation;
	import com.liangzhong.model.explore.vo.ExploreInfoVo;
	import com.liangzhong.model.explore.vo.FeelVo;
	import com.liangzhong.model.goods.vo.PlayerStarVo;
	import com.lz.football.module.explore.item.MoveItem;
	import com.lz.football.module.playerCenter.ListItem;
	
	import common.BaseView.BaseView;
	import common.BaseView.DisplayMouseEventManager;
	import common.comp.TabButtonBar;
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.SimpleButton;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.Point;
	import flash.text.TextField;
	
	import lz.controls.Alert;
	import lz.controls.LButton;
	
	/**
	 *探索 
	 * @author Administrator
	 * 
	 */	
	public class ExploreView extends BaseView implements IExploreView
	{
		/**
		 *关闭按钮 
		 */		
		public static var closeBtn :SimpleButton;
		/**
		 *  球员
		 */
		private var _playerMc:MovieClip;
		
		/**
		 *球员面板上的关闭按钮 
		 */
		private var _playerMcClostBtn:SimpleButton;
		/**
		 *探索 
		 */
		private var _exploreTime:MovieClip;
		/**
		 *球员容器 
		 */
		private var playerContain:MovieClip;
		/**
		 * 
		 */
		private var _exploreInfoVo:ExploreInfoVo;
		/**
		 *剩余时间 秒 
		 */		
		private var leftTime	:int;
		/**
		 *探索次数 
		 */
		private var _exploreTimeTxt:TextField;
		/**
		 *增加探索次数 
		 */
		private var addBtn:SimpleButton;
		/**
		 *签约  
		 */
		public static var signBtn:SimpleButton;
		/**
		 *增加好友度 
		 */
		private var addFeelBtn:SimpleButton;
		/**
		 *好感度 
		 */
		private var feel:TextField;
		/**
		 *签约条件  
		 */
		private var condition:TextField;
		
		/**
		 *签约时间 text
		 */
		private var timeTxt:TextField;
		/**
		 *签约剩余时间 
		 */
		private var _signTime:int;
		/**
		 *选中了球员 
		 */
		private var _selectItem:ListItem;
		/**
		 *探索地图 
		 */
		private var _map:ExploreMapView;
		
//		/**
//		 *荣誉球员提示 
//		 */
//		private var fameHallTip:TextField;
		/**
		 *等待播放动画的球员 
		 */
		private var _effList:Array;
		/**
		 * 
		 */
		private var _playerItemVec:Vector.<ListItem>;
		/**
		 *选中的vo 
		 */
		private var _selectFeelVo:FeelVo;
		private var openList:Array = ["开放亚澳洲，免费探索5次，每次探索3名球员，开放至紫色球星",
			"可探索出橙色球星，免费探索次数+1","开放非洲，免费探索次数+1",
			"增加一名探索球星数量，免费探索次数+1","增加一名探索球星数量，免费探索次数+1",
			"开放美洲，免费探索次数+1","开放欧洲，免费探索次数+1","可探索出红色球星，免费探索次数+1","可探索出黑色球星","",""];
		
		/**
		 *开放描述 
		 */
		private var openDes:TextField;
		
		
		
		/**
		 *选项卡 
		 */		
		private var buttonBar :TabButtonBar;
		public function ExploreView()
		{
			super();
		}
		/**
		 *背景 
		 * @return 
		 * 
		 */		
		public function get bg():DisplayObject
		{
			return null;
		}
		/**
		 * 
		 * @param view
		 * 
		 */
		override public function initUI(view:Object=null):void
		{
			symbolSkin = Reflection.createInstance("com.lz.modul.explore.mainView");
			this.addChild(symbolSkin);
			
			
			playerContain = symbolSkin.player.playerContain;
			if(_map == null)
			{
				_map = new ExploreMapView();
				_map.initUI(symbolSkin.map);
				_map.callBack = playExplore;
			}
//			fameHallTip = symbolSkin.fameHallTip;
//			fameHallTip.text = "";
			_playerMc = symbolSkin.player;
			_exploreTime = symbolSkin.exploreTime;
			_exploreTimeTxt = _exploreTime.exploreTime;
			_exploreTimeTxt.mouseEnabled = false;
			addBtn = _exploreTime.addBtn;
			timeTxt = _playerMc.timeTxt;
			signBtn = _playerMc.signBtn;
			_playerMcClostBtn = _playerMc.closeBtn;
			openDes = symbolSkin.openDes;
			openDes.text = "";
			feel = _playerMc.feel;
			addFeelBtn = _playerMc.addFeelBtn;
			condition = _playerMc.condition;
			_exploreInfoVo = AppData.getInstance().exploreDataManager.exploreInfo;
			_playerItemVec = new Vector.<ListItem>();
			
			var shape:Shape = new Shape();
			shape.graphics.clear() ;
			shape.graphics.beginFill(0xFFFFFF,1);
			shape.graphics.drawRect(symbolSkin.mapBg.x,symbolSkin.mapBg.y,symbolSkin.mapBg.width,symbolSkin.mapBg.height);
			shape.graphics.endFill();
			symbolSkin.addChild(shape);
			_playerMc.mask = shape;
			
			buttonBar = new TabButtonBar();
			var i :int = 0;
			var lbtn :LButton;
			var lbtns :Array = [];
			var list:Array = [0,7,31,36];
			var clubLv:int = AppData.getInstance().clubDatamanager.clubInfo.level;
			for(;i<4;i++)
			{
				lbtn = new LButton(symbolSkin["btnTable"]["type_" + (i + 1)]);
				if(clubLv >= list[i])
				{
					lbtn.enable = true;
				}else
				{
					lbtn.enable = false;
				}
				
				lbtns.push(lbtn);
			}
			buttonBar.setButtons(lbtns);
			buttonBar.selectTabButton(lbtns[0]);
			
//			hidePlayMc();
			_viewHeight = symbolSkin.height;
			_viewWidth = symbolSkin.width;
			_windowBg = symbolSkin.exploreBg;
			isCloseBtn = true;
			isDrag = true;
			moveClose(symbolSkin.width - 33,28);
			
			onResizeHandler();
			addEvtListener();
			showBaseInfo();
			upDataPlaer();
			chectSignTime();
			//@lake 2013-11-15
			closeBtn = _closeBtn;
			onTabChangeHandler();
			initexploreTypeStatus();
		}
		
		/**
		 *初始化探索类型状态 
		 * 
		 */
		private function initexploreTypeStatus():void
		{
			var clubLv:int = AppData.getInstance().clubDatamanager.clubInfo.level;
			if(clubLv < 7)
			{
				DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin["btnTable"]["type_" + 2],"橙色探索7级开放！");
			}else
			{
				DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin["btnTable"]["type_" + 2],"每次探索消耗50万欧元，橙色球星出现几率增加20倍！");
			}
			if(clubLv < 31)
			{
				DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin["btnTable"]["type_" + 3],"红色探索31开放！");
			}else
			{
				DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin["btnTable"]["type_" + 3],"每次探索消耗20点券，红色球星出现几率增加100倍！");
			}
			if(clubLv < 36)
			{
				DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin["btnTable"]["type_" + 4],"黑色探索36开放！");
			}else
			{
				DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin["btnTable"]["type_" + 4],"每次探索消耗100点券，黑色球星出现几率增加300倍！");
			}
		}
		/**
		 *显示基本信息 
		 * 
		 */
		private function showBaseInfo():void
		{
			buyExploreTime(null);
			var clubLv:int = AppData.getInstance().clubDatamanager.clubInfo.level
			_map.exploreLv(clubLv);
			if(clubLv < 7)
			{
				openDes.text = "俱乐部升到7级可以探索出橙色球星！开放非洲球星探索！";
			}else if(clubLv < 13)
			{
				openDes.text = "俱乐部升到13级可以同时探索4名球星！";
			}else if(clubLv <18)
			{
				openDes.text = "俱乐部升到18级可以同时探索5名球星，开放美洲球星探索！";
			}else if(clubLv < 22)
			{
				openDes.text = "俱乐部升到22级开放欧洲球星探索！";
			}else if(clubLv < 31)
			{
				openDes.text = "俱乐部升到31级可以探索出红色球星！";
			}else if(clubLv < 36)
			{
				openDes.text = "俱乐部升到36级可以探索出黑色球星！";
			}else 
			{
				openDes.text = "";
			}
			
		}
		/**
		 *检测签约时间 
		 * 
		 */
		private function chectSignTime():void
		{
			_signTime = AppData.getInstance().time - _exploreInfoVo.exploretime;
			_signTime = 1800 -_signTime
			if(_signTime > 0)
				TimerManager.instance.addFunction(updataSignTime);
			else
			{
				timeTxt.text = "00:00";
				clearPlayerItem();
				_selectItem = null;
				feel.text = "";
				condition.text = "";
				_selectFeelVo = null;
				hidePlayMc();
				TimerManager.instance.removeFunction(updataSignTime);
			}
		}
		/**
		 *更新探索时间 
		 * 
		 */
		private function updataSignTime():void
		{
			_signTime--;
			if(_signTime > 0)
			{
				timeTxt.text = DateUtil.formatShowHMS(_signTime,true);
			}
			else
			{
				clearPlayerItem();
				_selectItem = null;
				_selectFeelVo = null;
				timeTxt.text = "00:00";
				feel.text = "";
				condition.text = "";
				TimerManager.instance.removeFunction(updataSignTime);
				_playerMc.alpha = 0;
				_playerMc.y = 491;
				if(_playerMc.parent)_playerMc.parent.removeChild(_playerMc);
			}
		}
		
		
		/**
		 *更新球员数据 
		 * 
		 */
		private function upDataPlaer():void
		{
			clearPlayerItem();
			var arr:Array = _exploreInfoVo.starVoList;
			var len:int = arr.length;
			var i:int;
			var item:ListItem;
			for(i = 0;i < len;i++)
			{
				if(arr[i].startVo == null)continue;
				item = new ListItem();
				item.initUI();
				item.removeBar();
				
				item.data = arr[i].startVo;
				item.isShowTips = true;
				item.x = (item.width + 3)* playerContain.numChildren;
				item.callBack = selectItem;
				playerContain.addChild(item);
				_playerItemVec.push(item);
			}
			if(_playerItemVec.length > 0 && _playerItemVec[0] != null)
				selectItem(_playerItemVec[0]);
			hidePlayMc();
			
//			if(_playerItemVec.length <=4)
//			{
//				trace("球员数量不对");
//			}
			
		}
		/**
		 *是否隐藏球员面板 
		 * 
		 */
		private function hidePlayMc():void
		{
			if(playerContain.numChildren <= 0)
			{
				_playerMc.alpha = 0;
				_playerMc.y = 491;
				if(_playerMc.parent)_playerMc.parent.removeChild(_playerMc);
//				fameHallTip.text = "";
			}else
			{
				_playerMc.alpha = 1;
				_playerMc.y = 302;
				checkoutFameHall();
			}
		}
		/**
		 *清理显示的球员 
		 * 
		 */
		private function clearPlayerItem():void
		{
			while(_playerItemVec.length)
			{
				_playerItemVec.pop().destroyView();
			}
			
			var item:ListItem //= playerContain.getChildAt(0) as ListItem;
			while(playerContain.numChildren)
			{
				item = playerContain.removeChildAt(0) as ListItem;
				item.destroyView();
			}
		}

		/**
		 *选中了球员 
		 * @param $item
		 * 
		 */
		private function selectItem($item:ListItem):void
		{
			if(_selectItem != null)_selectItem.select = false;
			_selectItem = $item;
			_selectItem.select = true;
			
			var vo:PlayerStarVo = _selectItem.data as PlayerStarVo;
			var arr:Array = _exploreInfoVo.starVoList;
			var len:int = arr.length;
			var feelVo:FeelVo ;
			var i:int;
			for(i = 0;i < len;i++)
			{
				if(arr[i].startVo == vo)
				{
					_selectFeelVo = arr[i];
					break;
				}
			}
			if(_selectFeelVo == null)return;
			feel.text = "" + _selectFeelVo.feel;
			condition.text = _selectFeelVo.startVo.singCon;
			//			this.dispatchEvent(new ExploreEvent(ExploreEvent.add_feel,{tyep:_selectFeelVo.place,id:_selectFeelVo.playerId}));
			
		}
		
		override public function addEvtListener():void
		{
			super.addEvtListener();
			//			upLvBtn.addEventListener(MouseEvent.CLICK,onUpHandler);
			addBtn.addEventListener(MouseEvent.CLICK,onAddExploreTime);
			signBtn.addEventListener(MouseEvent.CLICK,onSignHandler);
			addFeelBtn.addEventListener(MouseEvent.CLICK,onAddFeelHandler);
			AppEventDispatcher.getInstance().addEventListener(ExploreEvent.EXPLORE_PLAYER,onExplorePlayer);
			
			DisplayMouseEventManager.instance.addTipsDisplay(addBtn,"增加免费探索次数");
			DisplayMouseEventManager.instance.addTipsDisplay(addFeelBtn,"花费20点券提升10点好感度");
			DisplayMouseEventManager.instance.addTipsDisplay(feel,"好感度越高，签约成功率越高！");
			
			DisplayMouseEventManager.instance.addTipsDisplay(symbolSkin.exploreTime,"俱乐部等级越高，免费探索次数越多");
			
			_playerMcClostBtn.addEventListener(MouseEvent.CLICK,onChangePlayerMcPlace);
			_playerMc.playerBg.addEventListener(MouseEvent.CLICK,onChangePlayerMcPlace);
			
			buttonBar.addEventListener(Event.CHANGE,onTabChangeHandler);
		}
		
		protected function onTabChangeHandler(event:Event = null):void
		{
			// TODO Auto-generated method stub
			var t:int = buttonBar.selectType + 1;
			var clubLv:int = AppData.getInstance().clubDatamanager.clubInfo.level;
			
			
			
			_map.exploreType = t;
			
			
		}
		
		protected function onChangePlayerMcPlace(event:MouseEvent):void
		{
			// TODO Auto-generated method stub
			var dp:DisplayObject = event.target as DisplayObject;
			if(dp == _playerMcClostBtn)
			{
				_playerMc.alpha = 1;
				_playerMc.y = 381;
				_playerMcClostBtn.visible = false;
			}else
			{
				_playerMc.alpha = 1;
				_playerMc.y = 302
				_playerMcClostBtn.visible = true;
			}
			
		}
		/**
		 *探索球员 
		 * @param event
		 * 
		 */		
		protected function onExplorePlayer(event:Event):void
		{
			// TODO Auto-generated method stub
			if(_map.exploreType == 1)
			{
				TweenLite.to(_playerMc,0.2,{y:491,alpha:0,onComplete:function compete():void{
					if(_playerMc.parent)_playerMc.parent.removeChild(_playerMc);
				}});
			}else
			{
				
			}
			
			
		
			condition.text = "";
			feel.text = "";
			_selectFeelVo = null;
			_selectItem = null;
			
			symbolSkin["btnTable"].mouseChildren = false;
			symbolSkin["btnTable"].mouseEnabled = false;
//			buttonBar.removeEventListener(Event.CHANGE,onTabChangeHandler);
//			fameHallTip.text = "";
		}
		
		/**
		 *增加好感度 
		 * @param event
		 * 
		 */
		protected function onAddFeelHandler(event:MouseEvent):void
		{
			if(_selectFeelVo == null)return;
			if(AppData.getInstance().clubDatamanager.clubInfo.cashpoint < 20)
			{
//				Alert.showErrorTip("点券不足不可以增加球员的好感度！");
				Alert.noCashAlert("现有点券不足20点，是否前往充值？");
				return ;
			}
			Alert.show("消耗20点券提高10点好感度，确定吗？","",Alert.NO,GlobalDef.AlertContainer,addFeelalert);
			
		}
		/**
		 *确认增加好感度 
		 * @param $type
		 * 
		 */		
		private function addFeelalert($type:int):void
		{
			if($type == Alert.YES)
			{
				this.dispatchEvent(new ExploreEvent(ExploreEvent.add_feel,{tyep:_selectFeelVo.place,id:_selectFeelVo.playerId}));
			}
		}
		/**
		 *关闭 
		 * @param event
		 * 
		 */
		override public function onCloseHandler(event:MouseEvent):void
		{
			this.dispatchEvent(new ExploreEvent(ModuleEvent.REMOVE_MODULE,null,true));
		}
		/**
		 *签约  
		 * @param event
		 * 
		 */
		protected function onSignHandler(event:MouseEvent):void
		{
			if(_selectItem == null)
			{
				Alert.showErrorTip("请选择签约的球员");
				return;
			}
			if(_selectFeelVo.startVo.coin > AppData.getInstance().clubDatamanager.clubInfo.coin)
			{
				Alert.showErrorTip("欧元不足，不可以签约");
				return;
			}
			if(_selectFeelVo.startVo.fame > AppData.getInstance().clubDatamanager.clubInfo.fame)
			{
				Alert.showErrorTip("声望不足，不可以签约");
				return;
			}
			var alDisp :* = Alert.show("是否签约此球员","",Alert.NO,GlobalDef.AlertContainer,alertSign);
			//@lake 2013-11-15
			AppEventDispatcher.getInstance().dispatchEvt("player_searchAlert",alDisp);
		}
		/**
		 * 
		 * @param $type
		 * 
		 */
		private function alertSign($type:int):void
		{
			
			if($type == Alert.YES)
			{
				if(_selectFeelVo == null)return;
				this.dispatchEvent(new ExploreEvent(ExploreEvent.SIGN,{type:_selectFeelVo.place,id:_selectFeelVo.playerId},true));
			}
		}
		/**
		 *增加探索次数 
		 * @param event
		 * 
		 */		
		protected function onAddExploreTime(event:MouseEvent):void
		{
			if(AppData.getInstance().clubDatamanager.clubInfo.coin < 100000)
			{
				Alert.showErrorTip("欧元不足，不可购买");
				return;
			}
			Alert.show("消耗100000欧元购买5次探索机会，确定吗？","",Alert.NO,GlobalDef.AlertContainer,alertbuyExploreTime);
		}
		/**
		 *是否购买探索次数 
		 * @param $type
		 * 
		 */		
		private function alertbuyExploreTime($type:int):void
		{
			if($type == Alert.YES)
			{
				this.dispatchEvent(new ExploreEvent(ExploreEvent.BUY_EXPLORE_TIME));
			}
		}
		/**
		 *返回购买次数 
		 * @param $obj
		 * 
		 */
		public function buyExploreTime($obj:Object):void
		{
			_exploreTimeTxt.text = _exploreInfoVo.explorecoin + "/" + _exploreInfoVo.explorecount;
		}
		/**
		 *增加好感度 
		 * @param $obj
		 * 
		 */
		public function addFeel($obj:Object):void
		{
			
			if(_selectFeelVo != null)feel.text = "" + _selectFeelVo.feel;
		}
		/**
		 *签约 
		 * @param $obj
		 * 
		 */
		public function sign($obj:Object):void
		{
			if(!$obj.status)
			{
				return;
			}
			upDataPlaer();
		}
		/**
		 *探索球员 
		 * @param $obj
		 * 
		 */
		public function explorePlayer($obj:Object):void
		{
			if(!$obj.status)
			{
//				_map.stopEffer();
				_map.setStatus();
				return;
			}
			this.removeEventListener(Event.ENTER_FRAME,onframeHandler);
			if(_map.exploreType != 1)
			{
//				_map.stopEffer();
				_map.setStatus();
				upDataPlaer();
				chectSignTime();
				symbolSkin.addChild(_playerMc);
				
				symbolSkin["btnTable"].mouseChildren = true;
				symbolSkin["btnTable"].mouseEnabled = true;
				_playerMcClostBtn.visible = true;
				return;
			}
			
			
			
			buyExploreTime(null);
			chectSignTime();
			clearPlayerItem();
			_effList = [];
			var len:int = _exploreInfoVo.starVoList.length;
			for(var i:int = 0;i < len;i++)
			{
				if(_exploreInfoVo.starVoList[i].startVo != null)
				{
					_effList.push(_exploreInfoVo.starVoList[i].startVo);
					
					
					
					var item:ListItem;
					item = new ListItem();
					item.initUI();
					item.removeBar();
					item.data = _exploreInfoVo.starVoList[i].startVo;
					item.isShowTips = true;
					item.callBack = selectItem;
					_playerItemVec.push(item);
				}
			}
			_map.airMove();
			
		}
		/**
		 * 播放动画  
		 * 
		 */
		private function playExplore():void
		{
			if(_playerItemVec == null || _playerItemVec.length == _map.showTime)
			{
				_map.stopEffer();
//				this.removeEventListener(Event.ENTER_FRAME,onframeHandler);
				
				return;
			}
			number=0;
			this.addEventListener(Event.ENTER_FRAME,onframeHandler);
			
			symbolSkin.addChild(_playerMc);
			TweenLite.to(_playerMc,0.3,{y:302,alpha:1});
			_playerMcClostBtn.visible = true;
			
			//			if(_effList.length == 0)_map.stopEffer();
		}
		/**
		 *显示搜索出来的球员完毕 面板出现
		 * @lake 2013-11-26 guide
		 */		
		private function showPlayerMCComplete():void
		{
			AppEventDispatcher.getInstance().dispatchEvent(new Event("Guide_explore_PlayerMc_AP"));
		}
		private var number:int;
		protected function onframeHandler(event:Event):void
		{
			
			
			if(_playerItemVec.length == _map.showTime)
			{
//				this.removeEventListener(Event.ENTER_FRAME,onframeHandler);
//				playFinish();
				if(_playerItemVec.length == playerContain.numChildren)
				{
					this.removeEventListener(Event.ENTER_FRAME,onframeHandler);
					playFinish();
					
					checkoutFameHall();
					
					symbolSkin["btnTable"].mouseChildren = true;
					symbolSkin["btnTable"].mouseEnabled = true;
					
					playFinish();
					_map.setStatus();
				}
				return;
			}
			number++;
			if(number < 10)return;
			
			var num:int = Math.floor(Math.random() * 31);
			number=0;
			var arr:Array = _map.getappearPoint();
			var startp:Point =new Point(arr[0],arr[1]);
			var start:Point = symbolSkin.localToGlobal(startp);
			var end:Point = new Point(_map.showTime * 58,0);
			var endp:Point = playerContain.localToGlobal(end);
			var vo:PlayerStarVo =_effList.pop();
			var mid:Point = new Point((GlobalDef.StageWidth >> 1)/* - Math.random() * 30*/,(GlobalDef.StageHeight /4)/* - Math.random() * 30*/);
			
			//			_bg.addChild(mc);
			var item:ListItem = _playerItemVec[_map.showTime];;
//			item = new ListItem();
//			item.initUI();
//			item.removeBar();
//			item.data = vo;
//			item.isShowTips = true;
//			item.callBack = selectItem;
//			_playerItemVec.push(item);
			var m:MoveItem = new MoveItem();
			m.setPoint(start,mid,endp);

			m.setContain(item,playerContain);
			_map.showTime++;
		}
		/**
		 *动画播放完成后 
		 * 
		 */
		private function playFinish():void
		{
			if(playerContain.numChildren >= 1)
			{
				var item:ListItem = playerContain.getChildAt(0) as ListItem;
				if(item == null)return;
				selectItem(item);
			}
			//@lake 2013-11-26
			showPlayerMCComplete();
			
//			buttonBar.addEventListener(Event.CHANGE,onTabChangeHandler);
		}
		override public function destroyView():void
		{
			removeEvtListener();
			clearPlayerItem();
			_map.destroyView();
			TweenLite.killTweensOf(_playerMc);
			DisplayMouseEventManager.instance.removeTipsDisplay(addBtn);
			DisplayMouseEventManager.instance.removeTipsDisplay(addFeelBtn);
			DisplayMouseEventManager.instance.removeTipsDisplay(feel);
			TimerManager.instance.removeFunction(updataSignTime);
			_playerItemVec = null;
			_selectItem = null;
			buttonBar.destroyView();
			buttonBar = null;
			super.destroyView();
			closeBtn = null;
			
		}
		override public function removeEvtListener():void
		{
			super.removeEvtListener();
			this.removeEventListener(Event.ENTER_FRAME,onframeHandler);
			addBtn.removeEventListener(MouseEvent.CLICK,onAddExploreTime);
			signBtn.removeEventListener(MouseEvent.CLICK,onSignHandler);
			addFeelBtn.removeEventListener(MouseEvent.CLICK,onAddFeelHandler);
			AppEventDispatcher.getInstance().removeEventListener(ExploreEvent.EXPLORE_PLAYER,onExplorePlayer);
			_playerMcClostBtn.removeEventListener(MouseEvent.CLICK,onChangePlayerMcPlace);
			_playerMc.playerBg.removeEventListener(MouseEvent.CLICK,onChangePlayerMcPlace);
			
			
			buttonBar.removeEventListener(Event.CHANGE,onTabChangeHandler);
			DisplayMouseEventManager.instance.removeTipsDisplay(addBtn);
			DisplayMouseEventManager.instance.removeTipsDisplay(addFeelBtn);
			DisplayMouseEventManager.instance.removeTipsDisplay(feel);
			DisplayMouseEventManager.instance.removeTipsDisplay(symbolSkin.exploreTime);
			
			DisplayMouseEventManager.instance.removeTipsDisplay(symbolSkin["btnTable"]["type_" + 2]);
			DisplayMouseEventManager.instance.removeTipsDisplay(symbolSkin["btnTable"]["type_" + 3]);
			DisplayMouseEventManager.instance.removeTipsDisplay(symbolSkin["btnTable"]["type_" + 4]);
			
		}
		
		
		/**
		 *检测是否有荣誉堂球员 
		 * 
		 */
		private function checkoutFameHall():void
		{
			return;
//			fameHallTip.text = "";
//			var arr:Array = _exploreInfoVo.starVoList;
//			var len:int = arr.length;
//			var str:String = "";
//			for(var i:int = 0;i < len;i++)
//			{
//				if(AppData.getInstance().fameHallDateManager.checkPlayerByID(arr[i].playerId))
//				{
//					//trace("探索到荣誉堂球员-->" + AppData.getInstance().goodsManager.getStarById(arr[i].playerId).name);
//					
//					//AppData.getInstance().goodsManager.getStarById(arr[i].playerId).name;
//					if(str == "")
//					{
//						str = AppData.getInstance().goodsManager.getStarById(arr[i].playerId).name;
//					}else
//					{
//						str = str + "," + AppData.getInstance().goodsManager.getStarById(arr[i].playerId).name;
//					}
//				}
//			}
//			
//			if(str != "")
//			{
//				fameHallTip.text = "恭喜您探索到【"+str+"】等荣誉堂球员";
//			}
//			
		}
		
	}
}